<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">


<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title> API Reference Documentation
        - Class: SubForm</title>
    <meta name="MSSmartTagsPreventParsing" content="true" />
    <meta http-equiv="imagetoolbar" content="no" />
    <link href="css/default.css" rel="stylesheet" type="text/css" />
    <link href="css/pygments.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div id="page">
        <div id="header">
            <h1> API Reference</h1>
        </div>
        <div id="browser">
            <div class="browser-section">
                <h2>Module Index</h2>
                <ul>
                    <li>
                        <a href="formosa.html">formosa</a>
                    </li><li class="active">
                        <a href="formosa.fields.html">formosa.fields</a>
                    </li><li>
                        <a href="formosa.validators.html">formosa.validators</a>
                    </li>
                </ul>
            </div>
            <div class="browser-section">
                <h2>Methods</h2>
                <ul>
                    <li>
                        <a href="formosa.fields.SubForm.html#method-has_value">has_value</a>
                    </li><li>
                        <a href="formosa.fields.SubForm.html#method-required">required</a>
                    </li><li>
                        <a href="formosa.fields.SubForm.html#method-translate">translate</a>
                    </li>
                </ul>
            </div>
            <div class="browser-section">
                <h2>Attributes</h2>
                <ul>
                    <li>
                        <a href="formosa.fields.SubForm.html#attribute-"></a>
                    </li>
                </ul>
            </div>
        </div>
        <div id="content">
    <h1>Class: SubForm</h1>
    <div class="docstring rst"><p>Container for a set of fields to be treated together as a single field.</p>
<p>A typical use case for this field is to treat as whole a set of fields,
where the set itself is optional but some member fields are required if
any values are given.  This would correspond to the other end of an
nullable foreign key in a relational database.</p>
<p>While there is a certain amount of isolation from it, it should still be
recognized that child fields belong to the same form as their parent
field.  In particular, care must be taken when assigning names of request
parameters to fields, as they use the same namespace as the rest of the
form.  The recommended way to accommodate this is to introduce some sort
of prefix for the parameter names of child fields, for example
<tt class="docutils literal"><span class="pre">'address_street'</span></tt>, <tt class="docutils literal"><span class="pre">'address_city'</span></tt>, etc.</p>
</div>
    <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
</ul>
    <div>
        <h2>Methods</h2>
            <h3 id="method-has_value">
                has_value
                <span class="args">(self, input)</span>
            </h3>
            <div class="docstring rst"><p>Return whether a value has been given for any of the child
fields in the given <tt class="docutils literal"><span class="pre">MultiDict</span></tt> of input.</p>
</div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
</ul>
            <h3 id="method-required">
                required
                <span class="args">(self)</span>
            </h3>
            <div class="docstring rst"><p>Return whether the field is mandatory.</p>
</div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
</ul>
            <h3 id="method-translate">
                translate
                <span class="args">(self, input)</span>
            </h3>
            <div class="docstring rst"><p>Translate the field from a <tt class="docutils literal"><span class="pre">MultiDict</span></tt> of values.</p>
<p>If the field is not required, and none of its child fields has a
value, return <tt class="docutils literal"><span class="pre">None</span></tt>.  Otherwise, process each child field.</p>
<p>Raise <tt class="docutils literal"><span class="pre">TranslationError</span></tt> if the field is required but none of its
child fields has a value, or <tt class="docutils literal"><span class="pre">ErrorSet</span></tt> if translation fails for of
any of the child fields.</p>
</div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
</ul>
    </div>
    <div>
        <h2>Attributes</h2>
            <h3 id="attribute-"></h3>
            <div class="docstring rst"></div>
            <h4>Value of </h4>
            <pre class="code"><code>None</code></pre>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
</ul>
    </div>
        </div>
        <div id="footer">
            Generated with <a href="http://apydia.ematia.de/" class="extern">
            Apydia 0.0.2</a> on 2008-11-26 11:09
        </div>
    </div>
</body>
</html>